<route lang="json5">
{
  style: {
    navigationStyle: 'default',
    navigationBarTitleText: '站内信',
  },
}
</route>
<template>
  <view>
    <uv-list>
      <uv-list-item direction="column" v-for="item in recordList" :key="item.id">
        <template #header>
          <uv-text :text="`类型：${item.messageType}`"></uv-text>
        </template>
        <template #body>
          <uv-text :text="`内容：${item.messageContent}`"></uv-text>
        </template>
        <template #footer>
          <uv-text :text="`时间：${item.messageAt}`"></uv-text>
        </template>
      </uv-list-item>
    </uv-list>
  </view>
</template>

<script setup lang="ts">
import type { PageQry } from '@/typings'
import { getPageMessage, postReadCurrentAll } from '@/service/message/message'
import { AppMessageVO } from '@/service/message/type'

const page = ref<PageQry>()
const recordList = ref<Array<AppMessageVO>>()
const loadData = async () => {
  const resData = await getPageMessage(page.value)
  recordList.value = resData.data.records
}
const readCurrentAll = async () => {
  await postReadCurrentAll()
}
onLoad(() => {
  loadData()
  readCurrentAll()
})
</script>

<style scoped lang="scss"></style>
